angular.module('app')
	.controller('TypeaheadDemoCtrl', ['$scope', '$http', function($scope, $http) {
//    $scope.selected = undefined;
//    $scope.states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 
//                     'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 
//                     'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 
//                     'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 
//                     'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 
//                     'New Mexico', 'New York', 'North Dakota', 'North Carolina', 
//                     'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 
//                     'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 
//                     'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 
//                     'Wyoming'];
//    // Any function returning a promise object can be used to load values asynchronously
//    $scope.getLocation = function(val) {
//      return $http.get('http://maps.googleapis.com/maps/api/geocode/json', {
//        params: {
//          address: val,
//          sensor: false
//        }
//      }).then(function(res){
//        var addresses = [];
//        angular.forEach(res.data.results, function(item){
//          addresses.push(item.formatted_address);
//        });
//        return addresses;
//      });
//    };
}]);
